package com.ease.platform.model.type;

import com.ease.common.enums.EnumUtil;
import com.ease.common.enums.OptionalEnum;

public enum PermissionDimensionSourceType implements OptionalEnum {

	User((short) 1, "自用户"), //
	UserLocation((short) 2, "自用户所属区域"), //
	UserGroup((short) 3, "自用户所属用户组"), //
	UserGroupLocation((short) 4, "自用户所属用户组所属区域"), //
	UserOrgnization((short) 5, "自用户所属组织机构"), //
	UserOrgnizationLocation((short) 6, "自用户所属组织机构所属区域"); //

	private short value;

	private String text;

	private PermissionDimensionSourceType(short value, String text) {
		this.value = value;
		this.text = text;
	}

	public final static PermissionDimensionSourceType get(short value) {
		return EnumUtil.get(PermissionDimensionSourceType.class, value);
	}

	public final static PermissionDimensionSourceType get(String name) {
		return EnumUtil.get(PermissionDimensionSourceType.class, name);
	}

	/**
	 * @return the text
	 */
	public String getText() {
		return text;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name();
	}

	/**
	 * @return the value
	 */
	public short getValue() {
		return value;
	}

}
